
<form class="form-horizontal" id="portForm" action="/index/portSave"
	method="POST">
	<div class="panel panel-default">
		<div class="panel-heading">
			<label>修改端口 - ${typeName} </label>
			<button class="btn btn-primary pull-right btn-xs" type="button">提交</button>
		</div>
		<div class="panel-body">
			<input name="type" type="hidden" value="${type!}">
			<div class="col-sm-3"></div>
			<div class="col-sm-6">
				<div class="form-group ">
					<label class="col-sm-3 control-label no-padding-right">${typeName}-端口</label>
					<div class="col-sm-9">
						<input type="text" name="port" value="${port!}"
							class="form-control required" placeholder="${typeName}">
					</div>
				</div>
			</div>
			<div class="col-sm-3"></div>
		</div>
		<div class="panel-footer">
			<small> 修改端口后，需要重新启动 </small>
			<button class="btn btn-primary pull-right btn-xs" type="button">提交</button>
		</div>
	</div>
</form>

<script>
$(function(){
	$('#portForm').on('click', 'button.btn-primary', function(e){
		e.preventDefault();
		var url = $('#portForm').attr('action');
		$.ajax({
            url: url,
            type:"post",
            data:{
            	type: $('#portForm [name="type"]').val(),
            	port: $('#portForm [name="port"]').val()
            },
            success: function(data){
            	$('#content').html(data);
            },
            error: function(e){
            }
        });    
	})
})
</script>